<template>
  <div class="board-card" :style="{ backgroundColor: board.color || '#026AA7' }">
    <router-link :to="`/board/${board._id}`" class="board-link">
      <h3>{{ board.title }}</h3>
      <p v-if="board.description">{{ board.description }}</p>
    </router-link>
    <div class="board-members">
      <Avatar 
        v-for="member in board.members" 
        :key="member.user._id"
        :user="member.user"
        size="small"
      />
    </div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue';
import Avatar from '../Common/Avatar.vue';

const props = defineProps({
  board: {
    type: Object,
    required: true
  }
});
</script>

<style scoped>
.board-card {
  border-radius: 3px;
  padding: 8px;
  margin: 8px;
  min-height: 100px;
  color: white;
}

.board-link {
  text-decoration: none;
  color: inherit;
}

.board-members {
  margin-top: 8px;
  display: flex;
  gap: 4px;
}
</style> 